package com.langfeiyes.pattern.proxy.staticproxy;



/**
 * 代理对象
 */
public class Proxy implements Subject {
    private Subject realSubject;
    public Proxy(Subject realSubject){
        this.realSubject = realSubject;
    }

    @Override
    public void request() {
        beforeRequest();
        realSubject.request();
        afterRequest();
    }

    private void beforeRequest(){
        System.out.println("代理对象：执行reqeust之前");
    }
    private void afterRequest(){
        System.out.println("代理对象：执行reqeust之后");
    }


    public Subject getRealSubject() {
        return realSubject;
    }
}
